﻿<cfsilent>
	<cfscript>
		
		datetimeAdvice = getProperty("serviceFactory").getBean("datetimeAdvice");
		
		subjectId = event.getArg("SBJ");
		grade = event.getArg("GRD");
		studentId = event.getArg("STU");
	
		/* 学生各项学分统计 */
		sql = "SELECT 
					a.credit, a.credit_req, a.credit_opt, a.credit_phy, a.credit_com, 
					a.credit_failure, 
					a.credit_grad, 
					b.gdc_passed, b.gdc_failure 
					FROM t_student_profile a 
					INNER JOIN t_grad_review b ON a.stu_id = b.stu_id 
					WHERE 
						a.stu_id = :studentId ";
		
		queryObj = new Query( datasource=application.dnsSlave );
		queryObj.addParam( name="studentId", value=studentId, cfsqltype="cf_sql_varchar" );

		rs_summary = queryObj.execute( sql=sql ).getResult();
		
		
		/* 读取审核结果 */
		sql = "SELECT 
					a.stu_gdr, 
					a.gdc, a.is_passed, a.result_descript, a.date_created, 
					b.tch_name 
					FROM t_grad_details a 
					INNER JOIN t_teacher b ON b.tch_id = a.tch_id 
					WHERE 
						a.stu_id = :studentId ";
		
		queryObj = new Query( datasource=application.dnsSlave );
		queryObj.addParam( name="studentId", value=studentId, cfsqltype="cf_sql_varchar" );

		rs_detail = queryObj.execute( sql=sql ).getResult();

  		passArgs = structNew();
		structInsert( passArgs, "SBJ", subjectId, true );
		structInsert( passArgs, "GRD", grade, true );
		structInsert( passArgs, "STU", studentId, true );
		
	</cfscript>
</cfsilent>

					<div class="noticeBlock">
						<h3>学分修读情况</h3>
						<hr/>
					</div>
					
					<div class="UICircle clearfix">
						<ul class="boxNavigation">
							<li class="huge"><em><cfoutput>#replace( numberFormat( rs_summary.credit, "_._" ), ".0", "" )#</cfoutput></em><span>总学分</span></li>
							<cfif rs_summary.credit_req>
								<li class="large deepblue"><em><cfoutput>#replace( numberFormat( rs_summary.credit_req, "_._" ), ".0", "" )#</cfoutput></em><span>必修课</span></li>
							</cfif>
							<cfif rs_summary.credit_opt>
								<li class="normal green"><em><cfoutput>#replace( numberFormat( rs_summary.credit_opt, "_._" ), ".0", "" )#</cfoutput></em><span>选修课</span></li>
							</cfif>
							<cfif rs_summary.credit_grad>
								<li class="normal"><em><cfoutput>#replace( numberFormat( rs_summary.credit_grad, "_._" ), ".0", "" )#</cfoutput></em><span>学位课</span></li>
							</cfif>
							<cfif rs_summary.credit_com>
								<li class="normal blue"><em><cfoutput>#replace( numberFormat( rs_summary.credit_com, "_._" ), ".0", "" )#</cfoutput></em><span>全校通选</span></li>
							</cfif>
							<cfif rs_summary.credit_phy>
								<li class="normal orange"><em><cfoutput>#replace( numberFormat( rs_summary.credit_phy, "_._" ), ".0", "" )#</cfoutput></em><span>体育类</span></li>
							</cfif>
	
							<cfif rs_summary.credit_failure>
								<li class="normal red"><em><cfoutput>#replace( numberFormat( rs_summary.credit_failure, "_._" ), ".0", "" )#</cfoutput></em><span>不及格学分</span></li>
							</cfif>
							<cfif rs_summary.gdc_passed>
								<li class="small describe green mtl"><em><cfoutput>#rs_summary.gdc_passed#</cfoutput></em><span>审核通过</span></li>
							</cfif>
							
							<cfif rs_summary.gdc_failure>
								<li class="small describe red mtl"><em><cfoutput>#rs_summary.gdc_failure#</cfoutput></em><span>未通过</span></li>
							</cfif>
							
						</ul>
					</div>
					
					<div class="noticeBlock">
						<h3>毕业审核结果</h3>
						<hr/>
					</div>
					
					<cfif rs_detail.recordCount>

							<table class="UItable">
								<tr class="cellLeader cellDot">
									<td width="30">项目</td>
									<td>结果</td>
									<td width="50">审查人</td>
									<td width="140">时间</td>
								</tr>

								<cfloop query="rs_detail">

									<cfset structInsert( passArgs, "GDR", rs_detail.stu_gdr, true ) />
									<tr class="cellDot <cfif rs_detail.is_passed eq "1">pass<cfelse>failure</cfif>">
										<td><span class="number bold"><cfoutput>#rs_detail.gdc#</cfoutput></span></td>
										<td><cfoutput>#rs_detail.result_descript#</cfoutput></td>
										<td><cfoutput>#rs_detail.tch_name#</cfoutput></td>
										<td><cfoutput>#datetimeAdvice.formatDateTimeString( rs_detail.date_created, "MM月DD日 HH时MI分" )#</cfoutput></td>
									</tr>
									
								</cfloop>
								<!--- 移除额外参数 --->
								<cfset structDelete( passArgs, "GDR", false ) />
								
							</table>
							
							
						<cfelse>
							<div class="systemNotice">
								还没有毕业条件审查记录
							</div>
					</cfif>
					
					